package com.ba.base.utils

fun formatMobile(mobile: String) = when (mobile.length) {
    11 -> {
        String.format(
            "%s %s %s",
            mobile.substring(0, 3),
            mobile.substring(3, 7),
            mobile.substring(7, 11)
        )
    }
    7 -> {
        String.format(
            "%s %s",
            mobile.substring(0, 3),
            mobile.substring(3, 7)
        )
    }
    else -> mobile
}

